
<script type="text/javascript" src="__PUBLIC__/Js/myup.js"></script>
<div class="page-content" >
	<div class="panel panel-default">
		<div class="panel-heading">
			<ul class="breadcrumb">
				<li><a href="<{:U('Index/pass')}>">密码管理</a> </li>
				<li class="active">修改密码</li>
			</ul>
		</div>
		<div class="panel-body">
			<form id="myform" enctype="multipart/form-data" class="form-horizontal" method="post" action="<{:U('passdo')}>">
				<div class="form-group" style="">
                                <label for="input-title" class="col-sm-2 control-label" style="" >头像：</label>
                                <div class="col-sm-7">
								
								<input type="file" id="showflag"  name="img" onchange="previewImage(this)"   />
                                  <div id="preview"></div>
                                    <img  id="showimg"  <if condition="$user_info['img']"> src="__Img__<{$admin_user_info.img}>" </if>  width="50" style="display: inline;"/>
                                 
                                </div>
                            </div>
				<div class="form-group">
					<label for="input-title" class="col-sm-2 control-label">用户名</label>
					<div class="col-sm-7"> <{$Think.session.user_name}> </div>
				</div>
				<div class="form-group">
					<label for="input-title" class="col-sm-2 control-label">原始密码</label>
					<div class="col-sm-7">
						<input type="password" placeholder="不修改请留空" class="form-control" name="oldpass" id="oldpass" />
					</div>
				</div>
				<div class="form-group">
					<label for="input-title" class="col-sm-2 control-label">新密码</label>
					<div class="col-sm-7">
						<input type="password"  placeholder="不修改请留空" class="form-control" name="newpass" id="newpass" />
					</div>
				</div>
				<div class="form-group">
					<label for="input-title" class="col-sm-2 control-label">确认密码</label>
					<div class="col-sm-7">
						<input type="password" placeholder="不修改请留空" class="form-control" name="cofpass" id="cofpass" />
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-7">
						<button type="submit" class="btn btn-primary">保存</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
<script>
 
$(function(){
    $(".form-horizontal").bootstrapValidator({
        message: '您填入的值不合法',
        fields:{
            oldpass: {
                message: '原始密码',
                validators: {
                   
					 remote: {
                        message: '原始密码不正确',
                        url: "<{:U('checkoldpass')}>"
                    },
                }
            },
			cofpass: {
                message: '密码',
                validators: {
                   
					callback: {
                        message: '密码不一致',
                        callback: function(value, validator) {
                            return value == $("#newpass").val();
                        }
                    },
                }
            },
			 
			  

        }
    });
	
 
});
 </script> 
